package com.sn.pw.service.impl;

//import cn.hutool.core.bean.BeanUtil;
//import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
//import com.sn.pw.code.ErrorMsg;
//import com.sn.pw.code.impl.BaseErrorCode;
//import com.sn.pw.dao.entity.Company;
//import com.sn.pw.dao.mapper.CompanyMapper;
//import com.sn.pw.service.CompanyService;
//import com.sn.pw.service.UserService;
//import com.sn.pw.vo.createreq.CompanyCreateReq;
//import com.sn.pw.vo.createreq.UserCreateReq;
//import lombok.RequiredArgsConstructor;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Lazy;
//import org.springframework.stereotype.Service;
//import org.springframework.transaction.annotation.Transactional;
//
//import java.util.List;
//
//@Service
//@Slf4j
//@RequiredArgsConstructor(onConstructor_ = {@Lazy})
//public class CompanyServiceImo extends ServiceImpl<CompanyMapper,Company> implements CompanyService {
//    @Autowired
//    UserService userService;
//    @Override
//    @Transactional(rollbackFor = Exception.class)
//    public boolean create(CompanyCreateReq param) {
//        return super.save(BeanUtil.toBean(param, Company.class));
//    }
//    @Override
//    @Transactional(rollbackFor = Exception.class)
//    public boolean createpeople(CompanyCreateReq param) {
//        List<UserCreateReq> userCreateReqList=param.getUserCreateReqList();
//        if(super.save(BeanUtil.toBean(param, Company.class)){
//            return userService.saveBatch(userCreateReqList);
//        }
//        return false;
//    }
//}

